package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Maintain;
import com.java.manage.service.MaintainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/maintain")
public class MaintainController {

    @Autowired
    private MaintainService maintainService;

    @PostMapping("/list")
    public Result list(@RequestBody Maintain maintain){
        return maintainService.list(maintain);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Maintain maintain) {
        return maintainService.save(maintain);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Maintain maintain) {
        return maintainService.modify(maintain);
    }

    @PostMapping("/getGenerate")
    public Result getGenerate(@RequestBody List<Maintain> maintain) {
        return maintainService.getGenerate(maintain);
    }

    @GetMapping("/remove")
    public Result remove(int[] ids) {
        return maintainService.remove(ids);
    }


}
